<?php
/**
 * Created by PhpStorm.
 * Author: 芸签cms www.yunqiancms.com
 * User: sun
 * Date: 2022/7/1
 * Time: 8:33 AM
 */
namespace app\common\models;

class Tag extends BaseModel
{
    public $table = 'yq_tag';
    public $timestamps = true;
    protected $guarded = [''];
    public static function getByName($name){
        return self::site()->select()
            ->where('name',$name)
            ->first();
    }

    public  function atributeNames() {
        return [
            'name'  => '标签名称'
        ];
    }

    public  function rules()
    {
        return [
            'name' => 'required'
        ];
    }
}